3.3.82 \(\int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx\) [282]

3.3.82.1 Optimal result
3.3.82.2 Mathematica [A] (verified)
3.3.82.3 Rubi [A] (verified)
3.3.82.4 Maple [A] (verified)
3.3.82.5 Fricas [A] (verification not implemented)
3.3.82.6 Sympy [B] (verification not implemented)
3.3.82.7 Maxima [F(-2)]
3.3.82.8 Giac [A] (verification not implemented)
3.3.82.9 Mupad [B] (verification not implemented)

3.3.82.1 Optimal result

Integrand size = 34, antiderivative size = 27 \[ \int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B x}{2}+\frac {B \cos (c+d x) \sin (c+d x)}{2 d} \]

output
1/2*B*x+1/2*B*cos(d*x+c)*sin(d*x+c)/d
 
3.3.82.2 Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89 \[ \int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B (2 (c+d x)+\sin (2 (c+d x)))}{4 d} \]

input
Integrate[(Cos[c + d*x]^2*(a*B + b*B*Cos[c + d*x]))/(a + b*Cos[c + d*x]),x 
]
 
output
(B*(2*(c + d*x) + Sin[2*(c + d*x)]))/(4*d)
 
3.3.82.3 Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2011, 3042, 3115, 24}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx\)

\(\Big \downarrow \) 2011

\(\displaystyle B \int \cos ^2(c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle B \int \sin \left (c+d x+\frac {\pi }{2}\right )^2dx\)

\(\Big \downarrow \) 3115

\(\displaystyle B \left (\frac {\int 1dx}{2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )\)

\(\Big \downarrow \) 24

\(\displaystyle B \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )\)

input
Int[(Cos[c + d*x]^2*(a*B + b*B*Cos[c + d*x]))/(a + b*Cos[c + d*x]),x]
 
output
B*(x/2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d))
 

3.3.82.3.1 Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 2011
Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> 
 Simp[(b/d)^m   Int[u*(c + d*v)^(m + n), x], x] /; FreeQ[{a, b, c, d, n}, x 
] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c + d*x 
, a + b*x])
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3115
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n)   Int[(b*Sin 
[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 
2*n]
 
3.3.82.4 Maple [A] (verified)

Time = 0.81 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.78

method result size
risch \(\frac {x B}{2}+\frac {B \sin \left (2 d x +2 c \right )}{4 d}\) \(21\)
parallelrisch \(\frac {B \left (2 d x +\sin \left (2 d x +2 c \right )\right )}{4 d}\) \(21\)
derivativedivides \(\frac {B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(28\)
default \(\frac {B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(28\)
norman \(\frac {\frac {B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {x B}{2}-\frac {B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {3 x B \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {3 x B \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {x B \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) \(98\)

input
int(cos(d*x+c)^2*(B*a+b*B*cos(d*x+c))/(a+cos(d*x+c)*b),x,method=_RETURNVER 
BOSE)
 
output
1/2*x*B+1/4*B/d*sin(2*d*x+2*c)
 
3.3.82.5 Fricas [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89 \[ \int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B d x + B \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \]

input
integrate(cos(d*x+c)^2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm= 
"fricas")
 
output
1/2*(B*d*x + B*cos(d*x + c)*sin(d*x + c))/d
 
3.3.82.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 68 vs. \(2 (22) = 44\).

Time = 0.39 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.52 \[ \int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\begin {cases} \frac {B x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {B x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {B \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\\frac {x \left (B a + B b \cos {\left (c \right )}\right ) \cos ^{2}{\left (c \right )}}{a + b \cos {\left (c \right )}} & \text {otherwise} \end {cases} \]

input
integrate(cos(d*x+c)**2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x)
 
output
Piecewise((B*x*sin(c + d*x)**2/2 + B*x*cos(c + d*x)**2/2 + B*sin(c + d*x)* 
cos(c + d*x)/(2*d), Ne(d, 0)), (x*(B*a + B*b*cos(c))*cos(c)**2/(a + b*cos( 
c)), True))
 
3.3.82.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\text {Exception raised: ValueError} \]

input
integrate(cos(d*x+c)^2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm= 
"maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f 
or more de
 
3.3.82.8 Giac [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.22 \[ \int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {{\left (d x + c\right )} B + \frac {B \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \]

input
integrate(cos(d*x+c)^2*(a*B+b*B*cos(d*x+c))/(a+b*cos(d*x+c)),x, algorithm= 
"giac")
 
output
1/2*((d*x + c)*B + B*tan(d*x + c)/(tan(d*x + c)^2 + 1))/d
 
3.3.82.9 Mupad [B] (verification not implemented)

Time = 0.91 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.85 \[ \int \frac {\cos ^2(c+d x) (a B+b B \cos (c+d x))}{a+b \cos (c+d x)} \, dx=\frac {B\,x}{2}+\frac {B\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-B\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^2} \]

input
int((cos(c + d*x)^2*(B*a + B*b*cos(c + d*x)))/(a + b*cos(c + d*x)),x)
 
output
(B*x)/2 + (B*tan(c/2 + (d*x)/2) - B*tan(c/2 + (d*x)/2)^3)/(d*(tan(c/2 + (d 
*x)/2)^2 + 1)^2)